import 'dart:async';

import 'package:flutter/material.dart';

class ColorRepo {
  static ColorRepo _instance;

  ColorRepo._();

  factory ColorRepo() {
    if (_instance == null) {
      _instance = ColorRepo._();
    }
    return _instance;
  }

  static var _controller = StreamController<MaterialColor>();

  static var _themeColorStream = _controller.stream.asBroadcastStream();

  Stream<MaterialColor> get themeColorStream => _themeColorStream;

  MaterialColor _themeColor;

  MaterialColor get themeColor => _themeColor;

  set themeColor(MaterialColor color) {
    _themeColor = color;
    _controller.add(color);
  }
}
